﻿using System;
using System.Net;
using System.Xml.Linq;

namespace ArmoryBrowser.Entities
{
    public class TalentSpec
    {
        #region Fields
        private string _groupField;
        private string _iconField;
        private string _primField;
        private string _treeOneField;
        private string _treeThreeField;
        private string _treeTwoField;
        private string _activeField;
        #endregion
        #region Properties
        public string Group
        {
            get
            {
                return this._groupField;
            }
            set
            {
                this._groupField = value;
            }
        }

        public string Icon
        {
            get
            {
                return this._iconField;
            }
            set
            {
                this._iconField = value;
            }
        }

        public string IconPath
        {
            get
            {
                return String.Format("http://armory.wow-europe.com/wow-icons/_images/43x43/{0}.png", Icon);
            }
        }

        public string Prim
        {
            get
            {
                return this._primField;
            }
            set
            {
                this._primField = value;
            }
        }

        public string TreeOne
        {
            get
            {
                return this._treeOneField;
            }
            set
            {
                this._treeOneField = value;
            }
        }

        public string TreeThree
        {
            get
            {
                return this._treeThreeField;
            }
            set
            {
                this._treeThreeField = value;
            }
        }

        public string TreeTwo
        {
            get
            {
                return this._treeTwoField;
            }
            set
            {
                this._treeTwoField = value;
            }
        }

        public string Active
        {
            get
            {
                return this._activeField;
            }
            set
            {
                this._activeField = value;
            }
        }
        #endregion
        #region Constructor
        public TalentSpec(XElement element)
        {
            Active = element.GetAttributeValue("active");
            Group = element.GetAttributeValue("group");
            Icon = element.GetAttributeValue("icon");
            Prim = element.GetAttributeValue("prim");
            TreeOne = element.GetAttributeValue("treeOne");
            TreeThree = element.GetAttributeValue("treeThree");
            TreeTwo = element.GetAttributeValue("treeTwo");
        }
        #endregion
    }
}
